<!--/*
Assignment 1
Class ID        : SE0691
Group           : 1
Due Date        : 20 November 2012
I declare that this assignment is my own work
in accordance with FPT Policy.
*/-->
<%@page import="java.text.DateFormat"%>
<script>
    var Digital=new Date()
    var hours=Digital.getHours()
    if (hours>=5&&hours<=11)
        document.write('<b>Welcome to myApartment systems. Good morning, sir.</b>')
    else if (hours==12)
        document.write('<b>It is high noon. Thanks for dropping by myApartment system!</b>')
    else if (hours>=13&&hours<=17) 
        document.write('<b>Good afternoon, and thanks for using myApartment system.</b>')
    else if (hours>=18&&hours<=20)
        document.write('<b>Good evening. Hope you\'re enjoying the gentle breeze</b>')
    else if (hours>=21&&hours<=11){
        document.write('<b>Glad to see you this time of the night.</b>')
        document.write('<b>Wow, thanks for choosing to visit myApartment system over sleep!</b>')}
</script>
<%
    String lastTimeVisit = "Never";
    if(session.getAttribute("lastTimeVisit")!=null){
        lastTimeVisit = session.getAttribute("lastTimeVisit").toString();
    }
            
    out.println("<p>Last time you access is: " + lastTimeVisit + "</p>");%>